<?php
session_start(); 
if(!isset($_SESSION['userName'])){
header( 'location:../index.php' ); 
} 
	include("../conf/connect.php");
	$user_id = $_SESSION['user_id'];
	$hhid= $_GET['hhid'];
	$search_id=$_GET['search_id'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />
	<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<body class="iub_back">


	<?php if($search_id==1){?>
	<table align="center" class="table_border">
			<tr>
					<td class="header"><b class="htext">IUB Survey :: </b><br /><hr /> </td>
			</tr>
			<tr>
					<td valign="top">Househod Info :  <a href="index2.php" class="input-box" > &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>
			<tr>
					<td> Answer(s) :</td>
			</tr>		
			<?php
				$sql ="SELECT * FROM raw_data where user_id='$user_id' and hid='$hhid'";
				$result=mysql_query( $sql);
				
				$sr='';
				$i=1;
				//echo"<pre>";
				while($row = mysql_fetch_assoc($result)){
				//print_r($row);
				//exit;
					for($i=1;$i<15;$i++){
						//echo $i;
						$s='q'.$i;
						$sr=$row["$s"];
						
					//q2='$age', q3='$sex', q4='$mStatus', q5='$relation', q6='$schooling', q7='$occupation', q8='$sType'
			?>
			<?php
						if($s=='q1'){
			?>
			<tr>
					<td>	<?php echo "Name : ".$sr;?></td>
					
			</tr>
			<?php	 	}
			
						else if($s=='q2'){
			?>
			<tr>
					<td>	<?php echo "Age : ".$sr;?></td>
					
			</tr>
			<?php	 	}
						
						else if($s=='q6'){//($s=='q9')||($s=='q10')||($s=='q11')||($s=='q13')){?>
			<tr>
					<td>	<?php echo "Yr of Schlng : ".$sr;?></td>
					
			</tr>
			<?php	 	}
			
						else if($s=='q9'){//($s=='q10')||($s=='q11')||($s=='q13')){?>
			<tr>
					<td>	<?php echo "Father : ".$sr;?></td>
					
			</tr>
			<?php	 	}
			
						else if($s=='q10'){//($i==5)||($s=='q6')||($s=='q9')||($s=='q10')||($s=='q11')||($s=='q13')){?>
			<tr>
					<td>	<?php echo "Mother : ".$sr;?></td>
					
			</tr>
			<?php	 	}
			
						else if($s=='q11'){
			?>
			<tr>
					<td>	<?php echo "Spouse : ".$sr;?></td>
					
			</tr>
			<?php	 	}
			
						else{
			?>
			
			<tr>
					<td>
						<?php 	
								$data='q'.$i;
						
								$hello="SELECT * FROM retreive_data where qus='$data' and hoption='$sr'";
								$end=mysql_query($hello);
								while($value=mysql_fetch_array($end)){
										if($s=='q3'){
											echo "Sex : ";
											echo $value['value'];
										}
										else if($s=='q4'){
											echo "Marital Status: ";
											echo $value['value'];
										}
										else if($s=='q5'){
											echo "Reltn with HHH: ";
											echo $value['value'];
										}
										else if($s=='q7'){
											echo "Occptn: ";
											echo $value['value'];
										}
										else if($s=='q8'){
											echo "Sch Type : ";
											echo $value['value'];
										}
										else if($s=='q12'){
											echo "Spouse Sch Type : ";
											echo $value['value'];
										}
										else if($s=='q13'){
											echo "Spouse Schln Yrs: ";
											echo $value['value'];
										}
										else if($s=='q14'){
											echo "Spouse Occptn: ";
											echo $value['value'];
										}										 
								}
								//$data=$row['hc01_1'];
								 
						?>
					</td>	
			</tr>
						
			<?php		}
				}	
			}			
								
				//}			
			?>
		
			<tr>
					<td align="right"><a href="index2.php" class="input-box"> &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>			
		</table>
		<?php }?>
		



		<?php if($search_id==2){?>
		<table align="center" class="table_border">
			<tr>
					<td class="header"><b class="htext">IUB Survey :: </b><br /><hr /> </td>
			</tr>
			<tr>
					<td valign="top">Househod Characteristics :  <a href="index2.php" class="input-box" > &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>
			<tr>
					<td> Answer(s) :</td>
			</tr>
			<?php
				$sql ="SELECT * FROM household_info where hid='$hhid'";
				$result=mysql_query( $sql);
				while($row = mysql_fetch_array($result)){
				?>	
			<tr>
					<td>Human/Animal Waste&nbsp;:&nbsp; <?php 
						$data=$row['hc01_1'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						} 
					?> </td>
			</tr>
			<tr>
					<td>Natural Waste&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc01_2'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_02' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Cowshed Nearby&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc01_3'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_03' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Household Clean&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc01_4'];
						
						$hello="SELECT * FROM retreive_data where qus='hc01_04' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>House Status&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc02'];
						
						$hello="SELECT * FROM retreive_data where qus='hc02' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>House Fare&nbsp;:&nbsp; <?php echo $row['hc03'];?></td>
			</tr>
			<tr>
					<td>MBed room floor type&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc05'];
						$hello="SELECT * FROM retreive_data where qus='hc05' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						
					?> </td>
			</tr>
			<tr>
					<td>MBed room wall type&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc06'];
						
						$hello="SELECT * FROM retreive_data where qus='hc06' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>MBed room roof type&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc07'];
						
						$hello="SELECT * FROM retreive_data where qus='hc07' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>House Electrified&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc08'];
						
						$hello="SELECT * FROM retreive_data where qus='hc08' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Any electrified house&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc09'];
						
						$hello="SELECT * FROM retreive_data where qus='hc09' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Main Drink water source&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc10'];
						
						$hello="SELECT * FROM retreive_data where qus='hc10' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Place&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc11'];
						
						$hello="SELECT * FROM retreive_data where qus='hc11' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Time to reach&nbsp;:&nbsp; <?php echo $row['hc12'];?>&nbsp;min</td>
			</tr>
			<tr>
					<td>Washing water source&nbsp;:&nbsp; 
					<?php 
						$data=$row['hc13'];
						
						$hello="SELECT * FROM retreive_data where qus='hc13' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Place&nbsp;:&nbsp; <?php 
						$data=$row['hc14'];
						
						$hello="SELECT * FROM retreive_data where qus='hc14' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Time to reach&nbsp;:&nbsp; <?php echo $row['hc15'];?>&nbsp;min</td>
			</tr>
			<tr>
					<td>Main Fuel&nbsp;:&nbsp; 
					<?php 
						$data=$row['h16'];
						
						$hello="SELECT * FROM retreive_data where qus='h16' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Cooking Area&nbsp;:&nbsp; 
					<?php 
						$data=$row['h17'];
						
						$hello="SELECT * FROM retreive_data where qus='h17' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Kithen has&nbsp;:&nbsp; 
					<?php 
						$data=$row['h18'];
						
						$hello="SELECT * FROM retreive_data where qus='h18' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Cooking Period&nbsp;:&nbsp; <?php echo $row['h19'];?></td>
			</tr>
			<tr>
					<td>Type of Latrine&nbsp;:&nbsp; 
					<?php 
						$data=$row['h20_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h20_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Sandal Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h21_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h21_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Frequency of washing hand&nbsp;:&nbsp; 
					<?php 
						$data=$row['h22_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h22_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?> </td>
			</tr>
			<tr>
					<td>Soap Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h23_01'];
						
						$hello="SELECT * FROM retreive_data where qus='h23_01' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Wash Before Meal&nbsp;:&nbsp; 
					<?php 
						$data=$row['h24'];
						
						$hello="SELECT * FROM retreive_data where qus='h24' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Soap Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h25'];
						
						$hello="SELECT * FROM retreive_data where qus='h25' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>When Used&nbsp;:&nbsp; 
					<?php 
						$data=$row['h26'];
						
						$hello="SELECT * FROM retreive_data where qus='h26' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Water Pure Method&nbsp;:&nbsp; 
					<?php 
						$data=$row['h27'];
						
						$hello="SELECT * FROM retreive_data where qus='h27' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
					?></td>
			</tr>
			<tr>
					<td>Suffering on food&nbsp;:&nbsp; <?php echo $row['h28_a_1'];?></td>
			</tr>
			<tr>
					<td>Suffering on cloth&nbsp;:&nbsp; <?php echo $row['h28_b_1'];?></td>
			</tr>
			<tr>
					<td>Suffering on bill pay&nbsp;:&nbsp; <?php echo $row['h28_c_1'];?></td>
			</tr>
			<tr>
					<td>Monthly Income&nbsp;:&nbsp; <?php echo $row['h29'];?></td>
			</tr>
			<tr>
					<td>Monthly Cost&nbsp;:&nbsp; <?php echo $row['h30'];?></td>
			</tr>
			<tr>
					<td>Cultivatable Land&nbsp;:&nbsp; <?php echo $row['h31'];?></td>
			</tr>
			<tr>
					<td>Measure&nbsp;:&nbsp; <?php echo $row['h32'];?></td>
			</tr>
			<?php 		
								
				}			
			?>
			<tr>
					<td align="right"><a href="index2.php" class="input-box"> &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>
		</table>
		<?php } ?>
		<?php if($search_id==3){?>
		<table align="center" class="table_border">
			<tr>
					<td class="header"><b class="htext">IUB Survey :: </b><br /><hr /> </td>
			</tr>
			<tr>
					<td valign="top">Househod Assets :  <a href="index2.php" class="input-box" > &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>
			<tr>
					<td> Answer(s) :</td>
			</tr>
			<?php
				$sql ="SELECT * FROM household_asset where hid='$hhid'";
				$result=mysql_query( $sql);
				while($row = mysql_fetch_array($result)){
				?>	
			<tr>
					<td>Motorbykes/Scuter&nbsp;:&nbsp; <?php echo $row['ha_01'];?></td>
			</tr>
			<tr>
					<td>Car/Zeep&nbsp;:&nbsp; <?php echo $row['ha_02'];?></td>
			</tr>
			<tr>
					<td>Other/Tractor&nbsp;:&nbsp; <?php echo $row['ha_03'];?></td>
			</tr>
			<tr>
					<td>Bicycle&nbsp;:&nbsp; <?php echo $row['ha_04'];?></td>
			</tr>
			<tr>
					<td>Bullock Curt&nbsp;:&nbsp; <?php echo $row['ha_05'];?></td>
			</tr>
			<tr>
					<td>Computer&nbsp;:&nbsp; <?php echo $row['ha_06'];?></td>
			</tr>
			<tr>
					<td>Washing Machine&nbsp;:&nbsp; <?php echo $row['ha_07'];?></td>
			</tr>
			<tr>
					<td>Kitchen Mixer&nbsp;:&nbsp; <?php echo $row['ha_08'];?></td>
			</tr>
			<tr>
					<td>Refrigerator&nbsp;:&nbsp; <?php echo $row['ha_09'];?></td>
			</tr>
			<tr>
					<td>Television&nbsp;:&nbsp; <?php echo $row['ha_10'];?></td>
			</tr>
			<tr>
					<td>Radio/Casstte&nbsp;:&nbsp; <?php echo $row['ha_11'];?></td>
			</tr>
			<tr>
					<td>Telephone&nbsp;:&nbsp; <?php echo $row['ha_12'];?></td>
			</tr>
			<tr>
					<td>Mobile Phone&nbsp;:&nbsp; <?php echo $row['ha_13'];?></td>
			</tr>
			<tr>
					<td>Fan&nbsp;:&nbsp; <?php echo $row['ha_14'];?></td>
			</tr>
			<tr>
					<td>Sewing Machine&nbsp;:&nbsp; <?php echo $row['ha_15'];?></td>
			</tr>
			<tr>
					<td>Watch&nbsp;:&nbsp; <?php echo $row['ha_16'];?></td>
			</tr>
			<tr>
					<td>Dining Table&nbsp;:&nbsp; <?php echo $row['ha_17'];?></td>
			</tr>
			<tr>
					<td>House(s)&nbsp;:&nbsp; <?php echo $row['ha_18'];?></td>
			</tr>
			<tr>
					<td>Ownland in the village&nbsp;:&nbsp; <?php echo $row['ha_19'];?></td>
			</tr>
			<tr>
					<td>Ownland in the town&nbsp;:&nbsp; <?php echo $row['ha_20'];?></td>
			</tr>
			<tr>
					<td>Bankbond&nbsp;:&nbsp; <?php echo $row['ha_21'];?></td>
			</tr>
			<tr>
					<td>Gold Jewelery&nbsp;:&nbsp; <?php echo $row['ha_22'];?></td>
			</tr>
			<tr>
					<td>Furniture&nbsp;:&nbsp; <?php echo $row['ha_23'];?></td>
			</tr>
			
			<?php 		
								
				}			
			?>
			
			<tr>
					<td align="right"><a href="index2.php" class="input-box"> &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>
		</table>
		<?php } ?>
		<?php if($search_id==4){?>
		<table align="center" class="table_border">
			<tr>
					<td class="header"><b class="htext">IUB Survey :: </b><br /><hr /> </td>
			</tr>
			<tr>
					<td valign="top">Househod Economic Hardships :  <a href="index2.php" class="input-box" > &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>
			<tr>
					<td> Answer(s) :</td>
			</tr>
			<?php
				$sql ="SELECT * FROM household_economic where hid='$hhid'";
				$result=mysql_query( $sql);
				while($row = mysql_fetch_assoc($result)){
				?>	
			<tr>
					<td>Last 1 Yr. Happenings:</td>
			</tr>
			<tr>
					<td>HEH01A: Death&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh01_a'];
						
						$hello="SELECT * FROM retreive_data where qus='heh01_a' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?> 
					</td>
			</tr>
			<tr>
					<td>HEH01B: Illness&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh01_b'];
						
						$hello="SELECT * FROM retreive_data where qus='heh01_b' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?> </td>
			</tr>
			<tr>
					<td>HEH01C: Crop Loss&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh01_c'];
						
						$hello="SELECT * FROM retreive_data where qus='heh01_c' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?> </td>
			</tr>
			<tr>
					<td>HEH01D: Natural Disaster&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh01_d'];
						
						$hello="SELECT * FROM retreive_data where qus='heh01_d' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?> </td>
			</tr>
			<tr>
					<td>HEH01E: Loss of job&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh01_e'];
						
						$hello="SELECT * FROM retreive_data where qus='heh01_e' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?> </td>
			</tr>
			<tr>
					<td>HEH01F: Low crop price&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh01_f'];
						
						$hello="SELECT * FROM retreive_data where qus='heh01_f' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr>
					<td>HEH01G: Business Loss&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh01_g'];
						
						$hello="SELECT * FROM retreive_data where qus='heh01_g' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr>
					<td><br />Economic Hardship Causes</td>
			</tr>	
			<tr <?php if($row['heh01_a']==3){?> style="display:none"<?php }?>>
					<td>HEH02A: Death&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh02_a'];
						
						$hello="SELECT * FROM retreive_data where qus='heh02_a' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr <?php if($row['heh01_b']==3){?> style="display:none"<?php }?>>
					<td>HEH02B: Illness&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh02_b'];
						
						$hello="SELECT * FROM retreive_data where qus='heh02_b' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr <?php if($row['heh01_c']==3){?> style="display:none"<?php }?>>
					<td>HEH02C: Crop Loss&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh02_c'];
						
						$hello="SELECT * FROM retreive_data where qus='heh02_c' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr <?php if($row['heh01_d']==3){?> style="display:none"<?php }?>>
					<td>HEH02D: Natural Disaster&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh02_d'];
						
						$hello="SELECT * FROM retreive_data where qus='heh02_d' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr <?php if($row['heh01_e']==3){?> style="display:none"<?php }?>>
					<td>HEH02E: Loss of job&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh02_e'];
						
						$hello="SELECT * FROM retreive_data where qus='heh02_e' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr <?php if($row['heh01_f']==3){?> style="display:none"<?php }?>>
					<td>HEH02F: Low crop price&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh02_f'];
						
						$hello="SELECT * FROM retreive_data where qus='heh02_f' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr <?php if($row['heh01_g']==3){?> style="display:none"<?php }?>>
					<td>HEH02G: Business Loss&nbsp;:&nbsp; 
					<?php 
						$data=$row['heh02_g'];
						
						$hello="SELECT * FROM retreive_data where qus='heh02_g' and hoption='$data'";
						$end=mysql_query($hello);
						while($value=mysql_fetch_array($end)){
							echo $value['value'];;
						}
						?></td>
			</tr>
			<tr>
					<td><br />How long ago?</td>
			</tr>
			<tr <?php if($row['heh01_a']=='3'||$row['heh02_a']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH03A: Death&nbsp;:&nbsp; <?php echo $row['heh03_a'];?></td>
			</tr>
			<tr <?php if($row['heh01_b']=='3'||$row['heh02_b']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH03B: Illness&nbsp;:&nbsp; <?php echo $row['heh03_b'];?></td>
			</tr>
			<tr <?php if($row['heh01_c']=='3'||$row['heh02_c']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH03C: Crop Loss&nbsp;:&nbsp;<?php echo $row['heh03_c'];?></td>
			</tr>
			<tr <?php if($row['heh01_d']=='3'||$row['heh02_d']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH03D: Natural Disaster&nbsp;:&nbsp; <?php echo $row['heh03_d'];?></td>
			</tr>
			<tr <?php if($row['heh01_e']=='3'||$row['heh02_e']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH03E: Loss of job&nbsp;:&nbsp; <?php echo $row['heh03_e'];?></td>
			</tr>
			<tr <?php if($row['heh01_f']=='3'||$row['heh02_f']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH03F: Low crop price&nbsp;:&nbsp; <?php echo $row['heh03_f'];?></td>
			</tr>
			<tr <?php if($row['heh01_g']=='3'||$row['heh02_g']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH03G: Business Loss&nbsp;:&nbsp; <?php echo $row['heh03_g'];?></td>
			</tr>
			<tr>
					<td><br />Recovery Measures</td>
			</tr>
			<tr <?php if($row['heh01_a']=='3'||$row['heh02_a']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH04A: Death&nbsp;:&nbsp; <?php echo $row['heh04_a'];?></td>
			</tr>
			<tr <?php if($row['heh01_b']=='3'||$row['heh02_b']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH04B: Illness&nbsp;:&nbsp; <?php echo $row['heh04_b'];?></td>
			</tr>
			<tr <?php if($row['heh01_c']=='3'||$row['heh02_c']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH04C: Crop Loss&nbsp;:&nbsp;<?php echo $row['heh04_c'];?></td>
			</tr>
			<tr <?php if($row['heh01_d']=='3'||$row['heh02_d']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH04D: Natural Disaster&nbsp;:&nbsp; <?php echo $row['heh04_d'];?></td>
			</tr>
			<tr <?php if($row['heh01_e']=='3'||$row['heh02_e']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH04E: Loss of job&nbsp;:&nbsp; <?php echo $row['heh04_e'];?></td>
			</tr>
			<tr <?php if($row['heh01_f']=='3'||$row['heh02_f']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH04F: Low crop price&nbsp;:&nbsp; <?php echo $row['heh04_f'];?></td>
			</tr>
			<tr <?php if($row['heh01_g']=='3'||$row['heh02_g']=='3'){?> style="display:none;"<?php }?>>
					<td>HEH04G: Business Loss&nbsp;:&nbsp; <?php echo $row['heh04_g'];?></td>
			</tr>
			<?php 		
								
				}			
			?>
			<tr>
					<td align="right"><a href="index2.php" class="input-box"> &nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp; </a></td>
			</tr>
		</table>
		<?php }?>
		
</body>
</html>